-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pf's anchor to load the rules for nat and port forwarding #8
base: master
Are you sure you want to change the base?
Conversation
lib/vagrant-bhyve/driver.rb
Outdated
@@ -146,6 +146,28 @@ def load_module(module_name) | |||
end | |||
end | |||
|
|||
def check_or_create_default_pfconf(ui) | |||
if execute(true, "test -s /etc/pf.conf") != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably, /etc/pf.conf
should not be hardcoded here but maybe taken from the pf_rules
rcvar
.
if execute(true, "test -s /etc/pf.conf") != 0 | ||
ui.warn I18n.t("vagrant_bhyve.action.vm.boot.create_default_pfconf") | ||
|
||
# probably this could be done in a nicer way with open and puts... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll replace this with a File.open(...)
block when I'm rebasing the next time.
pf_file.puts "set skip on #{bridge_name}" | ||
check_or_create_default_pfconf(ui) | ||
# set up bridge pf anchor | ||
pf_bridge_conf = "/usr/local/etc/pf.#{bridge_name}.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably this should also be somewhere in @data_dir
, as it's not really permanent configuration...
10c2902
to
2b47ada
Compare
Fixes #1